import { createContext } from "react";

export const AuthContext = createContext({
  isAuthenticated: false,
  user: null as any,
  login: (user: any) => {},
  logout: () => {},
});

export function useAuth() {
  const context = React.useContext(AuthContext);
  if (context === undefined) {
    throw new Error('useAuth must be used within an AuthProvider');
  }
  return context;
}